package cn.glutnn.controller;


import cn.glutnn.entity.Promotions;
import cn.glutnn.entity.Result;
import cn.glutnn.service.PromotionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;

/**
 * (Promotions)表控制层
 *
 * @author msh
 * @since 2024-12-14 17:11:10
 */
@RestController
@RequestMapping("/promotions")
public class PromotionsController {
    /**
     * 服务对象
     */
    @Autowired
    private PromotionsService promotionsService;

    // 获取所有促销信息
    @GetMapping("/list")
    public Result<List<Promotions>> list() {
        List<Promotions> promotionsList = promotionsService.list();
        return Result.success(promotionsList);
    }
}

